import { RouteConfig } from "vue-router"

const routes: Array<RouteConfig> = [
  {
    path: "/payments",
    name: "NewPayment",
    component: () => import("../views/payment"),
    props: (route) => ({
      orderIds: route.query.order_ids,
      totalAmount: route.query.total_amount,
    }),
    meta: { requiresAuth: true },
  },
  {
    path: "/payments/:id",
    name: "Payment",
    props: true,
    component: () => import("../views/payment").then(payment => payment.Result),
    meta: { requiresAuth: true },
  },
]

export default routes
